package com.example.designpatterns.decorator;

// 具体装饰器：为文本添加斜体效果
public class ItalicDecorator extends TextDecorator {
    public ItalicDecorator(TextComponent textComponent) {
        super(textComponent);
    }
    
    @Override
    public String getContent() {
        return "*" + textComponent.getContent() + "*";
    }

    @Override
    public void display() {
        System.out.println(getContent());
    }
}